import fs from 'fs'

/**
 * 读取文件
 */
export function readFileDir (name) {
  return new Promise((resolve,reject) => {
    const mypath = path.join(__dirname,`../assets/file/${name}`)
    fs.readFile(mypath,(err,data) => {
      if(err) return reject(err)
      resolve(data.toString())
    })
  })
}